import React from 'react'
import TextList from './TextList'
// 文章列表组件调用了图文列表组件
class ArticleList extends React.Component {
    constructor(props) {
        super(props)
        this.state = {
            list: [{
                imgSrc: 'http://a2.att.hudong.com/36/48/19300001357258133412489354717.jpg',
                title: '标题1',
                descript: '描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述'
            },
            {
                imgSrc: 'http://a2.att.hudong.com/36/48/19300001357258133412489354717.jpg',
                title: '标题2',
                descript: '描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述'
            },
            ,
            {
                imgSrc: 'http://a2.att.hudong.com/36/48/19300001357258133412489354717.jpg',
                title: '标题3',
                descript: '描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述'
            }]
        }
    }
    getListItems() {
        return this.state.list.map((value, index) => {
            return (
                <TextList
                    imgSrc={value.imgSrc}
                    title={value.title}
                    descript={value.descript}
                    key={index}
                />)
        })
    }
    render() {
        return (
            <ul>
                {this.getListItems()}
            </ul>
        )
    }
}
export default ArticleList;
